package primalgorithms.array;

import java.util.HashSet;

public class _04IfRepeated {
    public static boolean containsDuplicate(int[] nums) {
        //效率一般般
        HashSet<Integer> hashSet = new HashSet<>();
        for (int i = 0;i < nums.length;i++){
            hashSet.add(nums[i]);
        }
        return nums.length != hashSet.size();
    }
}
